package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.NoticeAfficheUser;
import com.zygh.policeasset.pojo.vo.NoticeAfficheUserVO;
import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/NoticeAfficheUserMapper.class */
public interface NoticeAfficheUserMapper {
    @Insert({"<script>INSERT INTO notice_affiche_user  (notice_affiche_id, user_id, status) VALUES  <foreach collection='NoticeAfficheUserList' item='NoticeAfficheUser'  separator=','> (#{NoticeAfficheUser.noticeAfficheId}, #{NoticeAfficheUser.userId}, #{NoticeAfficheUser.status})</foreach></script>"})
    Integer insertBatch(@Param("NoticeAfficheUserList") List<NoticeAfficheUser> list);

    @Results(id = "map", value = {@Result(property = "noticeAfficheId", column = "notice_affiche_id"), @Result(property = "userId", column = "user_id")})
    @Select({"<script>select nau.*,u.name as userName from notice_affiche_user nau left join user u on nau.user_id = u.id <where><if test='noticeAfficheId != null '>nau.notice_affiche_id = #{noticeAfficheId} </if><if test='userId != null '>and nau.user_id = #{userId} </if></where></script>"})
    List<NoticeAfficheUserVO> selectBynoticeAfficheId(@Param("noticeAfficheId") Integer num, @Param("userId") Integer num2);

    @Update({"<script>update notice_affiche_user <set> <if test='status != null '>status = #{status} </if></set> where user_id = #{userId} and notice_affiche_id = #{noticeAfficheId}</script>"})
    Integer updateRead(@Param("noticeAfficheId") Integer num, @Param("userId") Integer num2, @Param("status") Integer num3);
}